Repository navigation
fix(test): add lcov 2.x version-gated --ignore-errors for coverage scripts - #761
Conversation
…ripts CI 镜像 lcov 为 2.x,对 gcov 计数器与源码不一致(inconsistent/mismatch) 直接报错中断,任一阶段失败都会导致覆盖率无法产出(与 deepin-screen-recorder linuxdeepin#553、deepin-terminal linuxdeepin#531 同因)。按版本门控 (lcov >= 2 才加 --ignore-errors inconsistent,mismatch)注入全部 lcov/genhtml 调用,lcov 1.x 行为不变。 PMS: TASK-398635 Log: CI 单测覆盖率流水线 lcov 2.x 兼容 Influence: 不影响 lcov 1.x 本地行为
Reviewer's GuideImplementationAdd lcov-version detection and pass the lcov 2.x ignore-errors option to coverage capture and extract steps in the shared coverage script.
Version-gate and apply the ignore-errors option across the test runner’s lcov and genhtml calls so coverage generation can continue on lcov 2.x.
DocumentationAdd SPDX copyright and license headers to the shared coverage script.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
- 单年份版权行更新为创建年-2026 区间(CI SPDX 检查要求) - 为缺失 SPDX header 的脚本补充版权与 license 声明 PMS: TASK-398635 Log: CI SPDX 检查修复 Influence: 仅注释变更,不影响脚本逻辑
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: add-uos The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
1 similar comment
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: add-uos The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/forcemerge |
|
This pr force merged! (status: blocked, merge_method: rebase) |
问题
Gerrit-unittest-check 流水线 CI 镜像的 lcov 为 2.x,对 gcov 计数器与源码不一致(
ERROR: (inconsistent) mismatched end line)直接报错中断。项目中所有 lcov/genhtml 调用均未带--ignore-errors,任一阶段(capture/extract/remove/genhtml)失败即覆盖率无法产出,流水线记录 0.0%。deepin-screen-recorder(#553/#555/#561,PR #1101/#1103)与 deepin-terminal(#531/#544/#545,PR #608/#609)已确认并修复同因问题:terminal 修复后覆盖率 80.30%、screen-recorder 83.10%。
修复
lcov --version提取主版本号,>= 2 时LCOV_IG6="--ignore-errors inconsistent,mismatch"$LCOV_IGN(共 N 处)LCOV_IGN为空,行为不变验证
bash -n全部通过e4798910、deepin-screen-recorder82ae9f30完全一致(CI 已验证)PMS: TASK-398635
Summary by Sourcery
Keep coverage reporting compatible with both lcov 1.x and 2.x across the project’s coverage scripts.
Bug Fixes:
Chores: